home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-13 | 1.3 KB | 71 lines | [TEXT/ttxt] |
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class CHARACTER_REF
-
- inherit
- COMPARABLE
- redefine compare, out_in_tagged_out_memory,
- fill_tagged_out_memory
- end;
-
- creation make
-
- feature
-
- item: CHARACTER;
-
- make(value: CHARACTER) is
- do
- item := value;
- end;
-
- feature
-
- set_item(value: like item) is
- do
- item := value;
- end;
-
- infix "<" (other: like Current): BOOLEAN is
- -- Is Current less than `other'?
- do
- Result := item < other.item
- end;
-
- compare (other: like Current) : INTEGER is
- -- Compare Current with `other'.
- -- '<' <==> Result < 0
- -- '>' <==> Result > 0
- -- Otherwise Result = 0
- do
- Result := code - other.code
- end;
-
- code: INTEGER is
- -- ASCII code of Current
- do
- Result := item.code
- end;
-
- to_upper: like Current is
- -- Conversion of Current to upper case
- do
- !!Result.make (item.to_upper)
- end;
-
- to_lower: like Current is
- -- Conversion of Current to lower case
- do
- !!Result.make (item.to_lower)
- end;
-
- feature -- Object Printing :
-
- out_in_tagged_out_memory, fill_tagged_out_memory is
- do
- item.fill_tagged_out_memory;
- end;
-
- end -- CHARACTER_REF
-